/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-04-02
 * Time: 20:33
 */
public class TreeTest {
    public static void main(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        //插入元素
        binarySearchTree.insert(5);
        binarySearchTree.insert(3);
        binarySearchTree.insert(15);
        binarySearchTree.insert(1);
        binarySearchTree.insert(4);
        binarySearchTree.insert(11);
        binarySearchTree.insert(20);
        binarySearchTree.insert(0);
        binarySearchTree.insert(2);
        binarySearchTree.insert(10);
        binarySearchTree.insert(12);
        binarySearchTree.insert(17);
        binarySearchTree.insert(25);
        //查找元素
        System.out.println(binarySearchTree.search(20));
        //删除元素
        System.out.println(binarySearchTree.remove(15));
    }
}
